<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改合作伙伴')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content" >
		<form class="form-horizontal m" id="form-partner-edit" th:object="${partner}">
			<input id="partnerId" name="partnerId" type="hidden" th:field="*{partnerId}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label">合作伙伴名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="partnerName" id="partnerName" required th:field="*{partnerName}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">logo：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="partnerLogo" id="partnerLogo" required th:field="*{partnerLogo}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">网站地址：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="partnerNet" id="partnerNet" required th:field="*{partnerNet}">
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "user/partner";

		$("#form-post-add").validate({
			onkeyup: false,
			rules:{
				partnerNet:{
					remote: {
						url: prefix +"/checkNet",
						type: "post",
						dataType: "json",
						data: {
							"partnerNet" : function() {
								return $.common.trim($("#partnerNet").val());
							}
						},
						dataFilter: function(data, type) {
							return $.validate.unique(data);
						}
					}
				},
				postSort:{
					digits:true
				},
			},
			messages: {
				"partnerNet": {
					remote: "网址已经存在"
				}
			},
			focusCleanup: true
		});

		function submitHandler() {
			if ($.validate.form()) {
				$.operate.save(prefix + "/edit", $('#form-partner-edit').serialize());
			}
		}
	</script>
</body>
</html>
